load("@fbsource//tools/build_defs:rust_binary.bzl", "rust_binary")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("rust_libraries")

rust_library(
    name = "buck_resources",
    srcs = [
        "src/lib.rs",
        "src/manifest.rs",
    ],
    # Prefer to use the published version of this library through crates.io,
    # instead of this target. fbsource//third-party/rust:buck-resources
    visibility = [],
    deps = [
        "fbsource//third-party/rust:dunce",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:thiserror",
    ],
)

rust_binary(
    name = "hello",
    srcs = ["tests/src/hello.rs"],
    unittests = False,
)

rust_binary(
    name = "buck_resources_test",
    srcs = ["tests/src/main.rs"],
    resources = {
        "hello_binary": ":hello",
    },
    deps = [
        ":buck_resources",
    ],
)
